<?php

require_once 'Zend/Form/Element/Checkbox.php';

class ZFKiller_Form_Element_Checkbox extends Zend_Form_Element_Checkbox {

	public function __construct($spec, $options = null) {
		ZFKiller_Form_Element::formatDefaultOptions($spec, $options);
		parent::__construct($spec, $options);

		if (isset($options['multiOptions'])) {
			$this->addMultiOptions($options['multiOptions']);
		}
	}
	
	/**
     * Load default decorators
     *
     * @return Zend_Form_Element
     */
    public function loadDefaultDecorators()
    {
        if ($this->loadDefaultDecoratorsIsDisabled()) {
            return $this;
        }

        $decorators = $this->getDecorators();
        if (empty($decorators)) {
            $this->addDecorator('ViewHelperCheckbox')
                 ->addDecorator('Errors')
                 ->addDecorator('Description', array('tag' => 'p', 'class' => 'description'))
                 ->addDecorator('HtmlTag', array(
                     'tag' => 'dd',
                     'id'  => array('callback' => array(get_class($this), 'resolveElementId'))
                 ))
                 ->addDecorator('LabelCheckbox', array('tag' => 'dt'));
        }
        return $this;
    }

}